﻿using System;
using System.IO;

namespace Shared
{
    public abstract class PacketBase
    {
        #region Fields

        protected MemoryStream MemoryBuffer;

        public virtual byte[] Buffer
        {
            get
            {
                return this.MemoryBuffer.GetBuffer();
            }
            set { }
        }

        public int Size
        {
            get
            {
                return (int)this.MemoryBuffer.Length;
            }
        }

        public int Pointer
        {
            get
            {
                return (int)this.MemoryBuffer.Position;
            }
            set
            {
                this.MemoryBuffer.Position = value;
            }
        }

        #endregion
    }
}
